//
//  JddGlobal.m
//  116114
//
//  Created by Jdd‘s macbook on 13-11-28.
//  Copyright (c) 2013年 Raiyi. All rights reserved.
//

#import "JddGlobal.h"
@implementation JddGlobal
SHARED_INSTANCE_DEFINE(JddGlobal);
-(void)load{
    JddViewControllerManager *controllerManage = [JddViewControllerManager sharedInstance];
    controllerManage.navigationController = self.navigationController;
    self.tabBar = [JddTabBar getInstanceView];
    self.tabBar.delegate = controllerManage;
    self.tabBar.tintColor = UIColorFromRGB(0xdd161b);
    [self.window addSubview:self.tabBar];
    [self.window bringSubviewToFront:self.tabBar];

    [self.tabBar setFrame:CGRectMake(0,
                                     [[UIScreen mainScreen] bounds].size.height - self.tabBar.frame.size.height,
                                     [[UIScreen mainScreen] bounds].size.width,
                                     self.tabBar.frame.size.height)];
    
    self.waitingView = [JddWaitingView getInstanceView];
    self.waitingView.layer.cornerRadius = 8;
    self.waitingView.layer.masksToBounds = YES;
    [self.window addSubview:self.waitingView];
    [self.waitingView setFrame:CGRectMake(([[UIScreen mainScreen] bounds].size.width - self.waitingView.frame.size.width) / 2.0,
                                          ([[UIScreen mainScreen] bounds].size.height - self.waitingView.frame.size.height) / 2.0,
                                          self.waitingView.frame.size.width,
                                          self.waitingView.frame.size.height)];
    
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window bringSubviewToFront:self.tabBar];
    [self.window bringSubviewToFront:self.waitingView];
    [self.waitingView setHidden:YES];

}

@end
